package org.example.shejimoshi.yuanze.yilai;

/**
 * 接口传递方式调用
 */
public class PurchaseBook {
    private Book1 book1;

    public void getBook(Book1 book){
        book.getBook();
    }

    public static void main(String[] args) {
        PurchaseBook purchaseBook = new PurchaseBook();
        purchaseBook.getBook(new JavaBook1());
        purchaseBook.getBook(new PythonBook1());
    }
}
